package hexagon.autoconfigure;

import hexagon.security.service.HexagonSecurity;
import hexagon.security.service.impl.HexagonSecurityImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author XueguiYuan
 * @version 1.0 (created time: 2016/12/10).
 */
@Configuration
@ConditionalOnClass({HexagonSecurity.class})
public class HexagonSecurityAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public HexagonSecurity hexagonSecurity() {
        return new HexagonSecurityImpl();
    }
}
